3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
Figure 9 shows a box.
A box is a three-dimensional object defined by an origin (that is, a corner of the box) and three vectors that define the edges of the box that meet in that corner. A box may be used to model a cube, rectangular prism, or other parallelipiped. Attributes may be applied to each of the six faces of a box and to the entire geometry of the box.
The default surface parameterization for a box is as shown in Figure 10 .
Figure 10 The default surface parameterization of a box
Face attribute set list (optional), attribute set (optional). For the purpose of attribute assignment, the faces of a box are indexed as follows:
Container (
Box ( ... )
Container (
FaceAttributeSetList (6 Exclude 2 1 4)
Container (
AttributeSet ( ) #left face
DiffuseColor ( 1 0 0 )
)
Container (
AttributeSet ( ) #bottom face
DiffuseColor ( 0 1 1 )
)
Container (
AttributeSet ( ) #top face
DiffuseColor ( 0 1 0 )
)
Container (
AttributeSet ( ) #front face
DiffuseColor ( 1 0 1 )
)
)
Container (
AttributeSet ( )
DiffuseColor(0 0 0)
)
)
Previous | QD3D Book | Overview | Chapter Contents | Next |